package cn.wh.ymcc.feignclients;

import cn.wh.ymcc.doc.CourseDoc;
import cn.wh.ymcc.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "service-search",fallbackFactory = CourseSearchFeignClientFallBackFactory.class)
public interface CourseSearchFeignClient {

    /**
     * 课程上架
     * @param doc
     * @return
     */
    @PostMapping("/saveCourse")
    JSONResult saveCourse(@RequestBody CourseDoc doc);

    /**
     * 课程下架
     * @param doc
     * @return
     */
    @PostMapping("/deleteCourse/{courseId}")
    JSONResult deleteCourse(@PathVariable("courseId") Long courseId);
}
